<#assign p = p!0>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <#include "/common/common_head.ftl">
    <script>
      $(function(){
        //alert("sldkjf");
      });
      function jumpTo(url){
        //alert(url);
        $("#mainFrame").attr("src",url);
      }
    </script>
  </head>

  <body>
	<!-- 顶部导航菜单 S -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">ZMCMS（中麦后台管理系统）</a>
        </div>
        
        <div id="navbar" class="navbar-collapse collapse">    
          <ul class="nav navbar-nav">
            <li <#if !p?? || p==0>class="active"</#if>><a href="frameCtl.do">首页</a></li>

            <#list __USER__.menu as m>
              <#if m.pid == -1>
                <li <#if m.id == p>class="active"</#if>><a href="frameCtl.do?p=${m.id?if_exists}">${m.name?if_exists}</a></li>
              </#if>
            </#list>

          </ul>
        
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">${__USER__.name?if_exists}</a></li>
            <li><a href="logout.do">Exit</a></li>
          </ul>
          
        </div>
      </div>
    </nav>
	<!-- 顶部导航菜单 E -->
	
    <div class="container-fluid">
      <div class="row">
      	<!-- 功能菜单 S -->
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li class="active" data="102"><a href="javascript:void(0)">Operation Overview <span class="sr-only">(current)</span></a></li>
            <#assign idx = 0>
            <#assign cp = 'tpl_welcome.do' >
            <#list __USER__.menu as m>
              <#if m.pid == p>
                <li><a href="javascript:void(0)" id="category" onClick="jumpTo('${m.jurl?if_exists}');">${m.name?if_exists}</a></li>
                <#if idx == 0>
                  <#assign cp = '${m.jurl?if_exists}'>
                </#if>
                <#assign idx = idx + 1 >
              </#if>

            </#list>

          </ul>
        </div>
        <!-- 功能菜单 E -->
        
 		<!-- 主内容区域 S -->
 		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" id="mainBoard">

		<!-- 内容区 S -->
		<iframe id="mainFrame" name="main" src="${cp}" width=100% height=2000 frameborder="0" scrolling="" marginheight="0" marginwidth="0"/>
		<!-- 内容区 E -->

 		<!-- 主内容区域 E -->
        </div>

    </div>


  </body>
</html>
